Angle sensor with offline error correction

ABSTRACT

An angle sensor can have a plurality of magnetic field sensing elements configured to detect a magnetic field and generate a respective plurality of magnetic field signals. In response to these magnetic field signals, a processor generates an uncorrected angle signal that is indicative of an angle of the magnetic field. An error corrector generates an error value using one or more of the previous samples of the uncorrected angle signal, and a summation element applies the error value to a current sample of the uncorrected angle signal to generate a corrected angle signal. The error corrector can generate the error value by applying a correction factor to a previous sample of the uncorrected angle signal, or by applying a correction factor to a predicted current sample of the uncorrected angle signal.

BACKGROUND

Angle sensors can be used to provide angular position information androtational speed of a target such as a rotational shaft or otherrotational member. These sensors can be used in a wide array ofapplications such as industrial automation, robotics, power steering,motor position sensing and various vehicle applications such as seatbeltmotor systems, transmission actuators, shift-by-wire systems, electronicbraking systems and throttle systems.

Error correction can be provided by the angle sensors. Some of theseerrors can be associated with the device itself, such as device errorsassociated with the manufacturing process, or errors introduced bynon-linearities within the sensor's magnetic field sensing elements, orsensitivity to temperature variations. Other errors can be associatedwith the system within which the sensor operates such asapplication-specific performance and sensitivity requirements.

Calibration parameters can be stored onboard the angle sensor within anelectronically erasable programmable read-only memory (EEPROM) or anyother memory element such that the parameters are readily accessibleduring error correction procedures.

SUMMARY

Described herein is an angle sensor with a plurality of magnetic fieldsensing elements that are configured to detect a magnetic field andgenerate a respective plurality of magnetic field signals. The anglesensor can include a processor that is responsive to the plurality ofmagnetic field signals and that is configured to generate an uncorrectedangle signal that indicates an angle of the magnetic field. Alsoincluded is an error corrector that is configured to generate an errorvalue using one or more previous samples of the uncorrected anglesignal. The angle sensor can further include a summation element that isresponsive to a current sample of the uncorrected angle signal and tothe error value, where the summation element can be configured to applythe error value to the current sample of the uncorrected angle signal togenerate a corrected angle signal.

In some instances, the error corrector can be configured to apply acorrection factor to a previous sample of the uncorrected angle signalto generate the error value. The error corrector can be configured toapply the correction factor to the previous sample of the uncorrectedangle signal by applying amplitude and phase correction coefficients toa plurality of harmonics of the previous sample of the uncorrected anglesignal to generate the error value. The correction factor corresponds toone or more factory errors associated with the angle sensor.

In other instances, the angle sensor can include a second errorcorrector that is configured to generate a second error value using oneor more previous samples of the corrected angle signal. The angle sensorcan also include a second summation element that is responsive to acurrent sample of the corrected angle signal and to the second errorvalue and configured to apply the second error value to the currentsample of the corrected angle signal to generate a second correctedangle signal. In some instances, the second error corrector can beconfigured to apply a second correction factor to a previous sample ofthe corrected angle signal to generate the second error value. Thesecond error corrector can be configured to apply the second correctionfactor to the previous sample of the corrected angle signal by applyinga piecewise linear function of one or more correction coefficients tothe previous sample of the corrected angle signal to generate the seconderror value. The second correction factor can correspond to one or moresystem errors associated with a system in which the angle sensor isoperated.

In yet other embodiments, the error corrector can include a predictorthat is configured to predict a current sample of the uncorrected anglesignal based on the one or more previous samples of the uncorrectedangle signal, and apply the correction factor to the predicted currentsample of the uncorrected angle signal to generate the error value. Thecorrection factor can correspond to one or more factory errorsassociated with the angle sensor.

Also described is a method for correcting an angle signal of an anglesensor, wherein the method can include detecting a magnetic field togenerate a plurality of magnetic field signals. The method can alsoinclude generating an uncorrected angle signal indicative of an angle ofthe magnetic field and generating an error value using one or moreprevious samples of the uncorrected angle signal. The method can furtherinclude applying the error value to a current sample of the uncorrectedangle signal to generate a corrected angle signal.

In some embodiments, detecting the magnetic field can include detectingthe magnetic field using a plurality of magnetic field sensing elements.Further embodiments can include generating the uncorrected angle signalusing a CORDIC (coordinate rotation digital computer) processor.

Other embodiments include generating the error value by applying acorrection factor to a previous sample of the uncorrected angle signal,wherein applying can include applying amplitude and phase correctioncoefficients to a plurality of harmonics of the previous sample of theuncorrected angle signal. In some instances, the amplitude and phasecorrection coefficients can correspond to one or more factory errorsassociated with the angle sensor.

In some instances, the method can include generating a second errorvalue using one or more previous samples of the corrected angle signaland applying the second error value to the corrected angle signal togenerate a second corrected angle signal. Applying the second correctionfactor can include applying a piecewise linear function of one or morecorrection coefficients to the previous sample of the corrected anglesignal. The one or more correction coefficients can correspond to one ormore system errors that are associated with a system in which the anglesensor is operated.

In other instances, the method can include predicting the current sampleof the uncorrected angle signal based on the one or more previoussamples of the uncorrected angle signal and applying a correction factorto the predicted current sample of the uncorrected angle signal.

Still further described is an angle sensor that includes means fordetecting a magnetic field to generate a plurality of magnetic fieldsignals and means for generating an uncorrected angle signal indicativeof an angle of the magnetic field. Further included in the angle sensoris means for generating an error value using one or more previoussamples of the uncorrected angle signal and means for applying the errorvalue to a current sample of the uncorrected angle signal to generate acorrected angle signal.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, features and advantages will beapparent from the following more particular description of theembodiments and the appended claims, as illustrated in the accompanyingdrawings in which like reference characters refer to the same partsthroughout the detailed description. Reference characters introduced ina figure may be repeated in one or more subsequent figures withoutadditional description in the detailed description in order to providecontext for other features of the described embodiments.

FIG. 1 is a block diagram illustrating an embodiment of a prior artangle sensor and target;

FIG. 2 is a block diagram illustrating an embodiment of an offline errorcorrection sub-system within an angle sensor; and

FIG. 3 is a block diagram illustrating an embodiment of an offline errorcorrection sub-system within an angle sensor.

DETAILED DESCRIPTION

Illustrated in FIG. 1 is a prior art system for processing angle sensordata. The angle sensor 10 can be any sensor configured to provideangular position information, and in some instances speed and directioninformation, of a magnetic field associated with one or more targets 12.Additionally, the angle sensor 10 can be a contactless sensor that canprovide angular position and speed or direction information of thetarget 12. The angle sensor 10 can provide this target information overa span of zero to three-hundred-sixty degrees (0°-360°), or a reducedspan of one-hundred-eighty degrees (180°). Example targets 12 caninclude a rotating target 12 such as a gear or magnet attached to ashaft. Illustrated in FIG. 1 is one example of a target 12; the target12 can be any size or three-dimensional geometry.

The angle sensor 10 can generate high resolution output by executingerror correction and calibration applications that error correct andcalibrate the angle sensor 10 output to account for manufacturinginconsistencies (as may be referred to herein as factory errorcorrection) and for use in particular end-use applications (as may bereferred to herein as application error correction). Manufacturing orfabrication inconsistencies can also be referred to as factory errorsand can include device errors associated with manufacture of the anglesensor 10. These factory errors can also include: non-linearitiespresent within the magnetic field sensing elements (i.e., magnetic fieldsensing element X 40, and magnetic field sensing element Y 45);sensitivity variations of the sensing elements as a result oftemperature changes or aging of the device; and non-orthogonalitybetween the sensing channels 60, 70 of the sensing elements 40, 45.Application errors or system errors can include errors that are createdwhen the angle sensor 10 is used in a particular application. Theseerrors can be any non-linearity generated over the angle sensor 10output as a result of mounting the angle sensor 10 on an applicationboard. For example, in certain applications the angle sensor 10 can beinstalled on an application board such that the angle sensor 10 isplaced outside of a rotation axis of a rotating target. In this example,the out-of-rotation-axis placement causes the angle sensor 10 togenerate a non-linear transfer function of the magnetic angle versus thedevice output despite being used as a linear sensor. In other instances,application errors can be created when the angle sensor 10 is used in anatypical manner such as when the angle sensor 10 is used as a linearsensor thereby causing a non-linear transfer function of the angleversus the output. Still other types of errors are created when theangle sensor 10 does not conform to an application's performancerequirements or errors introduced by using the angle sensor 10 in asystem that operates at a certain speed, temperature, pressure or othersimilar parameter.

The angle sensor 10 can be used to sense the angular position, speedand/or the direction of a target 12 using one or more magnetic fieldsensing elements to detect a magnetic field and output magnetic fieldsignals representative of the sensed magnetic field. These magneticfield sensing elements can be a magneto-transistor or magnetoresistanceelement, or a semiconductor magnetoresistance element such as ananisotropic magnetoresistance (AMR) sensing element, a giantmagnetoresistance (GMR) sensing element, tunnel-magnetoresistance (TMR)sensing element, a magnetic tunnel junction (MTJ) sensing element,Indium Antimonide (InSb) or a Hall Effect element. In some embodiments,the magnetic field sensing element can be arranged to form a circularvertical hall (CVH) sensing element which can include a circular bodywith a plurality of Hall Effect elements disposed thereon and around thecircumference of the circular body.

Further referring to FIG. 1, the angle sensor 10 can have an X sensingchannel 60 that receives and processes raw sensor output from magneticfield sensing element X 40, and a Y sensing channel 70 that receives andprocesses raw sensor output from magnetic field sensing element Y 45.This raw sensor output can be magnetic field signals generated by themagnetic field sensing elements. The magnetic field sensing elements 40,45 can be arranged orthogonally with respect to each other such that oneof the magnetic field sensing elements 40, 45 generates a cosine signaland the other element 40, 45 generates a sine signal.

Each sensing channel 60, 70 can include a series of circuits orcomponents that process the magnetic field signals from the magneticfield sensing elements 40, 45. Included in each sensing channel 60, 70is an analog front end (AFE) which can include a filter, an amplifier orany other circuit element configured to attenuate or amplify amplitudesor filter frequencies. The AFE receives the magnetic field signals andoutputs modified magnetic field signals to an analog-to-digitalconverter (ADC) to digitize the magnetic field signals. Digitalfiltering circuitry and error correction circuitry included within thesensing channels 60, 70 receive the digitized magnetic field signals anderror correct the digitized signals. In some instances, the digitalfiltering circuit performs offset correction, sensitivity mismatchcompensation and non-orthogonality compensation. It should beappreciated that while FIG. 1 illustrates two magnetic field sensingelements, i.e., magnetic field sensing element X 40 and magnetic fieldsensing element Y 45, the angle sensor 10 can include more than twomagnetic field sensing elements. Additionally, the magnetic fieldsensing elements can be any magnetic field sensing elements describedherein.

An angle calculator 50 receives the digitized magnetic field signalsfrom the X sensing channel 60 and the Y sensing channel 70 and uses thedigitized magnetic field signals to generate an uncorrected angle signal140. This uncorrected angle signal 140 provides an impreciserepresentation of the magnetic field angle that contains errors. In someinstances, the angle calculator 50 can be a circuit comprising one ormore logic gates, or a processor configured to compute trigonometric,exponential and logarithmic functions. In other embodiments, the anglecalculator 50 is a coordinate rotation digital computer (CORDIC)processor configured to compute an arctangent function. The uncorrectedangle signal 140 generated by the angle calculator 50 represents aspectsof the sensed magnetic field such as the angular position and/or speedof a target 12.

The uncorrected angle signal 140 is processed by a digital signalprocessor 80 in order to reduce or remove errors. Illustrated in FIG. 1is a prior art digital signal processor 80 that error corrects theuncorrected angle signal 140 in a forward path such that each errorcorrector executes serially. For example, the application errorcorrector 30 cannot execute until the factory error corrector 20completes its error correction process and outputs the first correctedangle signal 144. Executing the error correctors 20, 30 in seriesincreases the amount of time between when the magnetic field signals aregenerated by the magnetic field sensing elements 40, 45 and when thelast error corrector 30 outputs a final corrected angle signal 148thereby increasing the latency of the angle sensor 10. This latency canbe mitigated by using faster hardware or parallel hardware architectureshowever, existing systems may not be capable of supplying the power orproviding the space required by faster hardware components or parallelhardware architectures. Additionally, faster hardware components orparallel hardware architectures are often cost prohibitive for certainapplications and systems.

The digital signal processor 80 includes a factory error corrector 20that receives the uncorrected angle signal 140 from the angle calculator50 and outputs a first corrected angle signal 144. The factory errorcorrector 20 can sometimes be referred to as a factory angle errorcorrector, harmonic corrector or a harmonic error corrector, or a firsterror corrector. In some instances, the factory error corrector 20 cancorrect aspects such as the offset and gain of the magnetic fieldsensing element X 40 portion or channel. The factory error corrector 20can also be used to correct aspects such as the offset and gain of themagnetic field sensing element Y 45 portion or channel. The factoryerror corrector 20 can also correct errors due to the non-orthogonalityof the magnetic field sensing elements 40, 45.

The factory error corrector 20 can use one or more stored coefficientsto reduce error in the uncorrected angle signal 140. These coefficientscan be stored locally within a memory element on the angle sensor 10 orremotely in a separate memory element. In some instances, thecoefficients can be stored during a factory trimming process. Whenstored in a remote location, the angle sensor 10 can access the storedcoefficients through a physical or wireless communication connection(i.e., a serial cable, a USB cable, an ethernet cable, a wirelessnetwork connection or any other similar type of connection).

The factory error corrector 20 can process the uncorrected angle signal140 in a manner illustrated by Equation 1, with which storedcoefficients can be applied to harmonic components of the angle signal.Thus, Equation 1 can be used to correct each harmonic error componentand generate the first corrected angle signal 144. The coefficients canbe error coefficients that correspond to or reflect factory ormanufacturing errors, such as those listed above, that may reside withinthe angle sensor 10.Angle′=Angle−Σ_(k=0) ^(N) A _(k) sin(k Angle+θ_(k))   Equation 1where Angle′ can correspond to the first corrected angle signal 144,Angle can correspond to the uncorrected angle signal 140, A_(k) is theamplitude coefficient and Ok is the phase coefficient for harmonic k,and “N” represents the number of harmonics over which the summationshould operate. For example, when N=4, first corrected angle signal 144can be determined using harmonics zero through three of the uncorrectedangle signal 140.

It should be noted that the error correction performed by the factoryerror corrector 20 can be performed to correct errors generated as aresult of manufacturing or fabrication inconsistencies. Additionally,the error correction can be performed to calibrate the angle sensor 10according to a predetermined set of standards. For example, the anglesensor 10 may be required to operate within a defined range of voltagesor, provide output angles or speed information within a certaintolerance range. Once fabricated into an integrated chip, the electricalcomponents of the angle sensor 10 cannot be modified, therefore thefactory error corrector 20 can be provided with hard-coded orprogrammable coefficients that are used to correct or offset differencesbetween the output and operating characteristics of a manufactured anglesensor 10 and an ideal or standard set of output and operatingcharacteristics.

The digital signal processor 80 includes a second error corrector, theapplication error corrector 30 which receives the first corrected anglesignal 144 from the factory error corrector 20 and outputs a secondcorrected angle signal 148. The application error corrector 30 cansometimes be referred to as a linearization block that implements one ormore piecewise linear correction algorithms to correct or calibrate thefirst corrected angle signal 144 for system-related requirements. Thislinear correction algorithm can be:

$\begin{matrix}{{{Angle}\mspace{14mu}{Output}} = {{Angle}^{\prime} - \lbrack {{\frac{y_{k + 1} - y_{k}}{x_{k + 1} - x_{k}}( {{Angle}^{\prime} - x_{k}} )} + y_{k}} \rbrack}} & {{Equation}\mspace{14mu} 2}\end{matrix}$Where Angle Output can correspond to the second corrected angle signal148, Angle′ can correspond to the first corrected angle signal 144, {x₀. . . x_(N-1)} in Equation 2 is an ordered set of linearizationcoefficients that represents the segment boundaries of first correctedangle signal 144 input to the application error corrector 30, and y_(i)are the angle errors to correct at each x_(i).

In some instances, the modifications carried out by the applicationerror corrector 30 can be referred to as segmented linearization thatuses a set of initial coefficients created by an end user or customer tocalibrate the angle sensor 10 for use in a particular application bylinearizing the output of the angle sensor 10 to generate the secondcorrected angle signal 148. To generate these linearizationcoefficients, an end user can employ the angle sensor 10 in a particularapplication and permit the angle sensor 10 to obtain samples from theangle sensor 10 within the end-user application over a full rotationalrange, i.e., zero to three-hundred-sixty degrees. The obtained samplescan constitute the set of the linearization coefficients and cancorrespond to system errors generated as a result of the angle sensor 10operating within an end-user system.

The prior art angle sensor 10 of FIG. 1 can be an angle sensor 10 thatexecutes a factory error corrector 20 and/or an application errorcorrector 30 that carries out various processes described in AllegroMicrosystems® Application Note 269121, i.e., the Application Informationsheet for the Allegro MicroSystems® A1332 chip, Advanced On-chipLinearization in the A1332 Angle Sensor IC, Alihusain Sirohiwala andWade Bussing, the contents of which are hereby incorporated by referencein their entirety.

Illustrated in FIG. 2 is a digital signal processor 81 that is animprovement of the digital signal processor 80 described in FIG. 1. Thisdigital signal processor 81 executes in parallel with a process forsampling the uncorrected angle signal 140 output by the angle calculator50. The improved digital signal processor 81 permits the angle sensor 10to provide high resolution angular position, speed and directioninformation with minimal or low latency. This minimal or low latency canbe achieved by reducing an amount of time required for the angle sensor10 to process, error-correct and calibrate the raw sensor output togenerate angular, speed or directional information that can be usedwithin a particular application.

In the digital signal processor 81, the factory error corrector 20 andthe application error corrector 30 execute in parallel to generate errorvalues using previous samples of the uncorrected angle signal 140,(i.e., uncorrected angle signal (n−1) 140′) and previous samples of thefirst corrected angle signal 145 (i.e., first corrected angle signal(n−1) 145′) to generate error values. These error values are applied tothe uncorrected angle signal 140 and the first corrected angle signal145 along the forward path, or the main signal path, to generate thefinal corrected angle signal 149. By removing the signal processing ofthe factory error corrector 20 and the application error corrector 30from the main signal path, the amount of time required to correct andcalibrate the uncorrected angle signal 140 can be reduced therebyreducing the latency of the angle sensor 10. Generating the error valuesoffline from the main signal path does not require additional circuitrythat would alter the power or space requirements of the angle sensor 10.Existing error correctors can be used in conjunction with this modifieddigital signal processor 81.

The digital signal processor 81 can sample one or more uncorrected anglesignal 140 samples from the angle calculator 50, where each of thesesamples can be denoted by “n” such that angle signal (n) 140 refers tothe “nth” sample. While the digital signal processor 81 samples theangle signal (n) 140 and moves it along the main signal path, a copy ofthe sampled uncorrected angle signal 140 corresponding to the nth sampleis saved in memory 120. In some instances, the memory 120 can be anEEPROM or any other memory suitable for saving uncorrected angle signal140 sample information. The digital signal processor 81 or correctors orother processing applications executing within the processor 81 cansample the uncorrected angle signal 140 and any other signals along themain signal path (i.e., the first corrected angle signal (n) 145) at ahigh sample rate such as at a sample rate of every two milliseconds.

The digital signal processor 81 samples the nth sample of theuncorrected angle signal 140 in parallel with the execution of thefactory error corrector 20 and/or the application error corrector 30.Within the digital signal processor 81, the factory error corrector 20can be configured to retrieve from memory 120 the previous sample of theuncorrected angle signal (n−1) 140′ and uses this previous sample 140′to generate an error value by applying correction factors 121 to thepreviously sampled uncorrected angle signal′ (n−1) 140′. Equation 3 is amodified version of Equation 1 that demonstrates the algorithms carriedout within the factory error corrector 20 when said algorithms areapplied to previous samples of the uncorrected angle signal (n) 140:Angle′(n)=Angle(n)−Σ_(k=0) ^(N) A _(k) sin(k Angle(n−1)+θ_(k)   Equation3where Angle′(n) is the first corrected angle signal (n) 145, Angle(n) isthe current sample of the uncorrected angle signal 140, Angle (n−1) isthe previous sample of the uncorrected angle signal 140′, A_(k) is theamplitude coefficient and Ok is the phase coefficient for harmonic k,and “N” represents the number of harmonics over which the summationshould operate. The correction factors 121 include the amplitudecoefficient A_(k) and the phase coefficient Ok for each error harmonicof a sample. In some instances, these correction factors 121 correspondto factory errors that may or may not be present in the angle sensor 10.

In this instance of the digital signal processor 81, the factory errorcorrector 20 applies the correction factors 121 to each error harmonic aprevious sample of the uncorrected angle signal (n−1) 140′. A sample ofthe uncorrected angle signal (n) 140 can have a plurality of errorharmonics, or k error harmonics. Thus, each sample can have k number ofcorrection factors 121. In some embodiments, the factory error corrector20 aggregates the results of applying the correction factors 121 to aplurality of error harmonics of a sample to generate the error value.While Equation 3 demonstrates applying the correction factors 121 to asingle previous sample, in other embodiments the error value can begenerated by applying correction factors 121 to one or more previoussamples of the uncorrected angle signal (n) 140. For example, thecorrection factors 121 can be applied to three previous samples, i.e.,uncorrected angle signal (n−1) 140′, uncorrected angle signal (n−2)140″, and uncorrected angle signal (n−3) 140′″.

The digital signal processor 81 uses the error value generated by thefactory error corrector 20 to correct the uncorrected angle signal (n)140. In some instances, the digital signal processor 81 corrects theuncorrected angle signal (n) 140 at an error correction point 130 on themain signal path. This error correction point 130 can be a summationelement that responds to receiving the current sample of the uncorrectedangle signal (n) 140 by applying the error value to the current sampleto yield a first corrected angle signal (n) 145. In some instances,applying the error value can include subtracting the error value fromthe current sample of the uncorrected angle signal (n) 140.

The error value can be used by the digital signal processor 81 to adjustor correct a current sample of the uncorrected angle signal 140 on themain signal path without a substantial time delay in an amount of timebetween when the angle calculator 50 outputs the uncorrected anglesignal (n) 140 and when the digital signal processor 81 outputs thefinal corrected angle signal 149. While the calculation of the errorvalue and the adjustment of the uncorrected angle signal 140 aredescribed herein in discrete terms, the calculation of the error valueand the adjustment of the uncorrected angle signal 140 can happencontinuously while the angle sensor 10 operates and while the digitalsignal processor 81 samples the uncorrected angle signal 140 and storesthe sampled signal 140 in memory.

The digital signal processor 81 can store a sample of the firstcorrected angle signal (n) 145 in memory 110 while simultaneously movingforward along the signal path to another error correction point 135. Theprocessor 81 operates in parallel to sample and store the firstcorrected angle signal (n) 145 and execute the application errorcorrector 30 to generate a second error value. The application errorcorrector 30 generates the second error value by applying a second setof correction factors 131 to a previous sample of the first correctedangle signal (n−1) 145′ obtained from memory 110. The second error valuecan be calculated using Equation 4 which is a modified version ofEquation 2:

$\begin{matrix}{{{Angle}\mspace{14mu}{Output}} = {{{Angle}^{\prime}(n)} - \lbrack {{\frac{y_{k + 1} - y_{k}}{x_{k + 1} - x_{k}}( {{{Angle}^{\prime}( {n + 1} )} - x_{k}} )} + y_{k}} \rbrack}} & {{Equation}\mspace{14mu} 4}\end{matrix}$where Angle Output is the final corrected angle signal 149, Angle′(n) isthe current sample of the first corrected angle signal (n) 145,Angle′(n−1) is the previous sample of the first corrected angle signal(n−1) 145′, {x₀ . . . x_(N-1)} is an ordered set of linearizationcoefficients that represents the segment boundaries of the previoussample of the first corrected angle signal 145′ input to the applicationerror corrector 30, and y_(i) are the angle errors to correct at eachx_(i). The correction factors 131 include the ordered set oflinearization coefficients, {x₀ . . . x_(N-1)}, and the angle errors,y_(i), that are corrected for each x_(i). There are k sets of correctionfactors 131 corresponding to the k number for each sample. In someinstances, the second set of correction factors 131 are associated witha system in which the angle sensor 10 is operated such that the factors131 correspond to system errors generated as a result of the anglesensor 10 operating within an end-user system. Additionally, or in otherinstances, the second set of correction factors 131 are associated withcalibration coefficients used to calibrate an angle sensor 10 for use ina particular system or application and so that the sensor 10 operatesaccording to a calibrated set of parameters.

In this instance of the digital signal processor 81, the applicationerror corrector 30 applies the correction factors 131 to a previoussample of the first corrected angle signal (n−1) 145′ by applying apiecewise linear function of correction coefficients x_(k), y_(k) to theprevious sample. Each sample can have k number of correction factors131. In some embodiments, the application error corrector 30 aggregatesthe results of applying the k number of correction factors 131 to asample to generate the second error value. While Equation 4 demonstratesapplying the correction factors 131 to a single previous sample, inother embodiments the second error value can be generated by applyingcorrection factors 131 to one or more previous samples of the firstcorrected angle signal (n) 145. For example, the correction factors 131can be applied to three previous samples, i.e., first corrected anglesignal (n−1) 145′, first corrected angle signal (n−2) 145″, and firstcorrected angle signal (n−3) 145′″.

The digital signal processor 81 uses the second error value generated bythe application error corrector 30 to correct the first corrected anglesignal (n) 145. To correct the first corrected angle signal (n) 145, thedigital signal processor 81 subtracts the second error value from thefirst corrected angle signal (n) 145 at an error correction point 135 onthe main signal path. This error correction point 135 can be a summationelement that responds to receiving the current sample of the firstcorrected angle signal (n) 145 by applying the second error value to thecurrent sample 145 to yield a final corrected angle signal (n) 149. Insome embodiments, applying the second error value can includesubtracting the second error value from the current sample of the firstcorrected angle signal (n) 145.

The second error value can be used by the digital signal processor 81 tofurther adjust or correct the first corrected angle signal 145 on themain signal path without a substantial time delay in an amount of timebetween when the angle calculator 50 outputs the uncorrected anglesignal (n) 140 and when the digital signal processor 81 outputs thefinal corrected angle signal 149. While the calculation of the seconderror value and the adjustment of the first corrected angle signal 145are described herein in discrete terms, the calculation of the seconderror value and the adjustment of the first corrected angle signal 145can happen continuously while the angle sensor 10 operates and while thedigital signal processor 81 samples the first corrected angle signal 145and stores the sampled signal 145 in memory.

When the digital signal processor 81 operates on angle sensor 10 outputobtained from measuring a stationary target 12, the modified equations(i.e. Equation 3 and Equation 4) can produce substantially zero error.When the target 12 is moving, the amount of error can be bounded basedon the maximum error correction applied, the maximum speed of the target12 and the throughput of the main signal path. This maximum error can beobtained by applying a maximum delta angle between samples (usingmaximum speed and signal path throughput) to the error corrector 20, 30at its maximum derivative point. This maximum error should be minimizedto ensure the angle sensor 10 operates within an amount of allowableerror.

Although the digital signal processor 81 illustrated in FIG. 2 uses botha factory error corrector 20 and an application error corrector 30, thesignal processor 81 can use either error corrector 20, 30 individually.For example, one instance of the digital signal processor 81 cancomprise only a factory error corrector 20, and another instance of thedigital signal processor 81 can comprise only an application errorcorrector 30. Furthermore, other types of error correction circuitry andtechniques, or post-processing of the signal can be performed in thedescribed offline manner in which the error corrector operates inparallel with the main forward signal path and in some instances, on aprevious sample of the signal processed in the main forward signal pathsuch as temperature correction.

Illustrated in FIG. 3 is an enhancement to the digital signal processor81 illustrated in FIG. 2. In this embodiment of the digital signalprocessor 82, any error introduced by using the offline error correctionsystems and methods described herein is further minimized by using apredictor in conjunction with the factory error corrector 20 and/or theapplication error corrector 30 to apply correction factors to apredicted current sample of the uncorrected angle signal 140 to generatean error value that can be applied to the current sample of theuncorrected angle signal (n) 140 to generate a corrected angle signal(n) 159.

In this instance, the digital signal processor 82 samples theuncorrected angle signal (n) 140 and stores a copy of the sampled signalin one or more memory locations 170. These stored samples can beretrieved by the digital signal processor 82 or a sub-processor withinthe processor 82 to generate a predicted angle signal (n) 162. One ormore previous samples of the uncorrected angle signal′ (n−1) 140′ can becombined by a summation element 150 to generate this predicted anglesignal (n) 162. The number of previous samples used to generate thepredicted angle signal (n) 162 can range from the “n-1” sample to the“n-p” sample, where “n” represents the sample most recently stored, and“p” represents an increasing value that starts at the value of “n” suchthat “n-p” represents the oldest stored sample. Each previous sample ofthe uncorrected angle signal 140 from the first sample (n−1) 140′ to thelast sample (n−p) 160 can be weighted by one or more gain elements 172and then averaged by a summation element 150 to generate a predictedangle signal (n) 162. This summation can be carried out according toEquation 5:

$\begin{matrix}{{{Angle}\mspace{14mu}{Signal}\mspace{14mu}{Estimation}\mspace{14mu}(n)} = {\sum\limits_{k = 1}^{N}{a_{k}\mspace{11mu}{Angle}\;( {n - k} )}}} & {{Equation}\mspace{14mu} 5}\end{matrix}$

where Angle Signal Estimation (n) is the predicted angle signal (n) 162,a_(k) is an amplitude weighting factor, k is the sample number of theuncorrected angle signal, coefficient, Nis the number of previoussamples of the uncorrected angle signal used to generate the predictedangle signal (n) 162, and Angle(n−k) is the uncorrected angle signal(n−1) 140′. The predicted angle signal (n) 162 sample can be referred toas a predicted value of the current sample of the uncorrected anglesignal 140. Equation 5 can be any type of linear estimator that can usea single prior sample or “N” number of prior samples to predict thevalue of the current sample of the uncorrected angle signal 140. In someinstances, the “N” number of prior samples can be consecutive sampleswhile in other instances, the “N” prior samples are not consecutive. Forexample, every fifth sample could be used to predict the present valueof the uncorrected angle signal 140.

The factory error corrector 20 applies correction factors 121 to thepredicted angle signal (n) 162 sample to generate an error value. Thedigital signal processor 82 applies the error value to the uncorrectedangle signal (n) 140 using a summation element 133 which subtracts theerror value from the uncorrected angle signal (n) 140 to generate thecorrected angle signal 159.

While FIG. 3 demonstrates a digital signal processor 82 that uses afactory error corrector 20, the digital signal processor 82 can use anapplication error corrector 30 (not shown) to generate a second errorvalue that the digital signal processor 82 applies to the correctedangle signal 159 to further correct for application errors or errorsassociated with a system within which the angle sensor 10 is operated.Furthermore, the digital signal processor 82 can use both the factoryerror corrector 20 and application error corrector 30 together, orindividually.

Using the estimated angle signal at a point in time, or sample “n”,permits a reduction in the error introduced by using the offline errorcorrection described herein. Such reduction can be due in part to theability to select the order and coefficients of the predicted signal inapplications where the throughput of the signal path is great enoughthat using the offline error corrector described in FIG. 2 and FIG. 3would otherwise cause the angle sensor 10 to exceed a maximum amount ofallowable error during operation.

The methods and systems described herein can be used in conjunction withapplications, methods and systems described in U.S. Pat. No. 9,400,164entitled “Magnetic Field Sensor and Related Techniques that Provide anAngle Correction Module” and issued on Jul. 26, 2016, and U.S. Pat. No.9,389,060 entitled “Magnetic Field Sensor and Related Techniques thatProvide an Angle Correction Module” and issued on Jul. 12, 2016, both ofwhich are assigned to the Assignee of the subject disclosure andincorporated herein by reference in their entirety.

It should be appreciated that the circuit architectures and methodsdescribed herein are merely embodiments of the system for offline errorcorrection, and that aspects of this system can be modified whilemaintaining the function of the system. All publications and referencescited herein are expressly incorporated by reference in their entirety.

What is claimed is:
 1. An angle sensor comprising: a plurality ofmagnetic field sensing elements configured to detect a magnetic fieldand generate a respective plurality of magnetic field signals; aprocessor responsive to the plurality of magnetic field signals andconfigured to generate an uncorrected angle signal indicative of anangle of the magnetic field; an error corrector configured to generatean error value using one or more previous samples of the uncorrectedangle signal; and a summation element responsive to a current sample ofthe uncorrected angle signal and to the error value and configured toapply the error value to the current sample of the uncorrected anglesignal to generate a corrected angle signal.
 2. The angle sensor ofclaim 1 wherein the error corrector is configured to apply a correctionfactor to a previous sample of the uncorrected angle signal to generatethe error value.
 3. The angle sensor of claim 2 wherein the errorcorrector is configured to apply the correction factor to the previoussample of the uncorrected angle signal by applying amplitude and phasecorrection coefficients to a plurality of harmonics of the previoussample of the uncorrected angle signal to generate the error value. 4.The angle sensor of claim 2 wherein the correction factor corresponds toone or more factory errors associated with the angle sensor.
 5. Theangle sensor of claim 1 further comprising: a second error correctorconfigured to generate a second error value using one or more previoussamples of the corrected angle signal; and a second summation elementresponsive to a current sample of the corrected angle signal and to thesecond error value and configured to apply the second error value to thecurrent sample of the corrected angle signal to generate a secondcorrected angle signal.
 6. The angle sensor of claim 5 wherein thesecond error corrector is configured to apply a second correction factorto a previous sample of the corrected angle signal to generate thesecond error value.
 7. The angle sensor of claim 6 wherein the seconderror corrector is configured to apply the second correction factor tothe previous sample of the corrected angle signal by applying apiecewise linear function of one or more correction coefficients to theprevious sample of the corrected angle signal to generate the seconderror value.
 8. The angle sensor of claim 6 wherein the secondcorrection factor corresponds to one or more system errors associatedwith a system in which the angle sensor is operated.
 9. The angle sensorof claim 1 further comprising a predictor configured to predict acurrent sample of the uncorrected angle signal based on the one or moreprevious samples of the uncorrected angle signal and wherein the errorcorrector is configured to apply the correction factor to the predictedcurrent sample of the uncorrected angle signal to generate the errorvalue.
 10. The angle sensor of claim 9 wherein the correction factorcorresponds to one or more factory errors associated with the anglesensor.
 11. A method for correcting an angle signal of an angle sensorcomprising: detecting a magnetic field to generate a plurality ofmagnetic field signals; generating an uncorrected angle signalindicative of an angle of the magnetic field; generating an error valueusing one or more previous samples of the uncorrected angle signal; andapplying the error value to a current sample of the uncorrected anglesignal to generate a corrected angle signal.
 12. The method of claim 11wherein detecting the magnetic field comprises detecting the magneticfield using a plurality of magnetic field sensing elements.
 13. Themethod of claim 11 wherein generating the uncorrected angle signalcomprises generating the uncorrected angle signal using a CORDICprocessor.
 14. The method of claim 11 wherein generating the error valuefurther comprises applying a correction factor to a previous sample ofthe uncorrected angle signal.
 15. The method of claim 14 whereinapplying the correction factor to the previous sample of the uncorrectedangle signal comprises applying amplitude and phase correctioncoefficients to a plurality of harmonics of the previous sample of theuncorrected angle signal.
 16. The method of claim 15 wherein amplitudeand phase correction coefficients correspond to one or more factoryerrors associated with the angle sensor.
 17. The method of claim 11further comprising: generating a second error value using one or moreprevious samples of the corrected angle signal; and applying the seconderror value to the corrected angle signal to generate a second correctedangle signal.
 18. The method of claim 17 wherein applying the secondcorrection factor to the previous sample of the corrected angle signalcomprises applying a piecewise linear function of one or more correctioncoefficients to the previous sample of the corrected angle signal. 19.The method of claim 18 wherein the one or more correction coefficientscorrespond to one or more system errors associated with a system inwhich the angle sensor is operated.
 20. The method of claim 11 furthercomprising: predicting the current sample of the uncorrected anglesignal based on the one or more previous samples of the uncorrectedangle signal; and applying a correction factor to the predicted currentsample of the uncorrected angle signal to generate the error value. 21.An angle sensor comprising: means for detecting a magnetic field togenerate a plurality of magnetic field signals; means for generating anuncorrected angle signal indicative of an angle of the magnetic field;means for generating an error value using one or more previous samplesof the uncorrected angle signal; and means for applying the error valueto a current sample of the uncorrected angle signal to generate acorrected angle signal.